package com.xbongbong.pro.link.business.pojo;

import com.xbongbong.paas.field.LinkConditionPoJo;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.List;

/**
 * @author 吴峰
 * @version v1.0
 * @date 2019/10/30 15:16
 * @since v1.0
 */
@Getter
@Setter
@ToString
public class LinkBusinessListPojo implements Serializable {

    private static final long serialVersionUID = -6787463643628385822L;

    private Long id;
    /**
     * 当前字段不能为空
     */
    @NotEmpty(message = "当前字段不能为空")
    private String attr;
    /**
     * 当前表的id
     */
    @NotNull(message = "当前表的id不能为空")
    private Long formId;

    private String name;
    /**
     * 当前表的业务类型
     */
    @NotNull(message = "当前表业务类型不能为空")
    private Integer businessType;
    /**
     * 关联业务的应用id
     */
    private Long linkAppId;
    /**
     * 关联业务的菜单id
     */
    private Long linkMenuId;
    /**
     * 关联业务的saas标识
     */
    private Integer linkSaasMark;
    /**
     * 关联业务的表单id
     */
    @NotNull(message = "关联业务的表单id不能为空")
    private Long linkFormId;
    /**
     * 关联业务表单的业务类型
     */
    @NotNull(message = "关联业务表单的业务类型不能为空")
    private Integer linkBusinessType;

    /**
     * 显示的字段
     */
    @Valid
    private List<LinkBusinessFieldPojo> field;
    /**
     * 搜索条件
     */
    @Size(max = 5, message = "搜索的条件不能超过5个")
    @Valid
    private List<LinkConditionPoJo> conditionList;
}
